package cn.lisens.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CustomFilter implements Filter {
	
	private static final Logger logger = LoggerFactory.getLogger(CustomFilter.class);

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		HttpServletRequest httpRequest = (HttpServletRequest) request;
        
        logger.info("Filter - 请求前: {}", httpRequest.getRequestURI());
        
        // 执行过滤链，继续处理请求
        chain.doFilter(request, response);
        
        logger.info("Filter - 请求后");

	}

}
